From: Carlos Garnacho Date: Wed, 1 Jul 2015 13:51:15 +0000 (+0200) Subject: windowManager: refactor WorkspaceSwitchAction callback into separate function X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~1294 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=804563d5b23db71f3d45bdd5a381bd280c702489;p=gnome-shell.git windowManager: refactor WorkspaceSwitchAction callback into separate function This will be used by the touchpad-specific "action" too, so put it in a shared place. https://bugzilla.gnome.org/show_bug.cgi?id=752250 --- diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js index 5c66190f8..e28ed2d9b 100644 --- a/js/ui/windowManager.js +++ b/js/ui/windowManager.js @@ -866,15 +866,18 @@ const WindowManager = new Lang.Class({ false, -1, 1); let gesture = new WorkspaceSwitchAction(); - gesture.connect('activated', Lang.bind(this, function(action, direction) { - let newWs = global.screen.get_active_workspace().get_neighbor(direction); - this.actionMoveWorkspace(newWs); - })); + gesture.connect('activated', Lang.bind(this, this._actionSwitchWorkspace)); global.stage.add_action(gesture); gesture = new AppSwitchAction(); gesture.connect('activated', Lang.bind(this, this._switchApp)); global.stage.add_action(gesture); + + }, + + _actionSwitchWorkspace: function(action, direction) { + let newWs = global.screen.get_active_workspace().get_neighbor(direction); + this.actionMoveWorkspace(newWs); }, _lookupIndex: function (windows, metaWindow) {